how to find value of x in factorial equation